/* --------------------------------------------------------
 * Copyright (c) aeky , Inc.  All rights reserved.
 * --------------------------------------------------------
 */
package com.aeky.client.common;

import java.util.HashMap;
import java.util.Map;

/**
 * 
 * @author aeky
 */
public final class Registry {

    private static Map<String, Object> map = new HashMap<String, Object>();

    private Registry() {

    }

    public static void registry(String key, Object value) {
        map.put(key, value);
    }

    public static void unRegistry(String key) {
        map.remove(key);
    }

    public static void unRegistryAll() {
        map.clear();
    }

    @SuppressWarnings("unchecked")
    public static <X> X get(String key) {
        return (X) map.get(key);
    }

    public Map<String, Object> getAll() {
        return map;
    }

}
